package com.igeek.oa.controller;

import com.igeek.oa.entity.Offsupapply;
import com.igeek.oa.entity.PurchaseGoods;
import com.igeek.oa.result.Result;
import com.igeek.oa.service.IPurchaseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/purchase")
@Api("物品采购申请表")
public class PurchaseController {
    @Autowired
    private IPurchaseService iPurchaseService;
    @PostMapping("/addPurchase/{shenQingPerNo}/{deptId}/{shenQingMoney}")
    public void addPurchase(@ApiParam("采购申请人编号")@PathVariable("shenQingPerNo") String shenQingPerNo,
                            @ApiParam("采购部门编号") @PathVariable("deptId") String deptId,
                            @ApiParam("采购总金额") @PathVariable("shenQingMoney") String shenQingMoney,
                            @ApiParam("采购物品详情") @RequestBody List<PurchaseGoods> shopMess){
        iPurchaseService.addPurchase(shenQingPerNo,deptId,shenQingMoney,shopMess);
    }
}
